import { Injectable } from '@nestjs/common';
import { CreateSwiperDto } from './dto/create-swiper.dto';
import { UpdateSwiperDto } from './dto/update-swiper.dto';
import {Repository} from 'typeorm'
import {Swiper} from './entities/swiper.entity'
import { InjectRepository } from '@nestjs/typeorm';

@Injectable()
export class SwiperService {
  constructor(
    @InjectRepository(Swiper)
    private swiperRepository:Repository<Swiper>
  ){}
  async create(createSwiperDto: CreateSwiperDto) {
    return await this.swiperRepository.save(createSwiperDto);
  }

  async findAll(query) {
    console.log(query);
    
    return await this.swiperRepository.find(query);
  }

  findOne(id: number) {
    return `This action returns a #${id} swiper`;
  }

  update(id: number, updateSwiperDto: UpdateSwiperDto) {
    return `This action updates a #${id} swiper`;
  }

  remove(id: number) {
    return `This action removes a #${id} swiper`;
  }
}
